import 'package:flutter/material.dart';
import 'lib/app/widgets/math_formula_widget.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: '分数转换测试',
      home: TestScreen(),
    );
  }
}

class TestScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('分数转换测试'),
      ),
      body: Padding(
        padding: EdgeInsets.all(16.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text('题目内容测试:', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
            SizedBox(height: 8),
            MathFormulaWidget(
              content: '计算 (1/2) + (3/4) 的值',
              style: TextStyle(fontSize: 16),
            ),
            SizedBox(height: 16),
            
            Text('选项A测试:', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
            SizedBox(height: 8),
            MathFormulaWidget(
              content: '(5/4)',
              style: TextStyle(fontSize: 16),
            ),
            SizedBox(height: 16),
            
            Text('选项B测试:', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
            SizedBox(height: 8),
            MathFormulaWidget(
              content: '((1+2)/3)',
              style: TextStyle(fontSize: 16),
            ),
            SizedBox(height: 16),
            
            Text('解析测试:', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
            SizedBox(height: 8),
            MathFormulaWidget(
              content: '首先计算 (1/2) = 0.5，然后计算 (3/4) = 0.75，最后相加得到 (5/4) = 1.25',
              style: TextStyle(fontSize: 16, color: Colors.blue),
            ),
            SizedBox(height: 16),
            
            Text('复杂分数测试:', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
            SizedBox(height: 8),
            MathFormulaWidget(
              content: '计算 (现期量/(1 + r)) 和 ((1 + r)/现期量) 的关系',
              style: TextStyle(fontSize: 16),
            ),
          ],
        ),
      ),
    );
  }
}